//
//  SMSCodeView.swift
//  Exchange
//
//  Created by 孟祥群 on 2018/4/19.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit
import SpriteKit
class SMSCodeView: UIView {
    lazy var nameLabel: UILabel =  {
        let label = BaseLabel(style: .oneStyle)
        label.textColor = KCommonTextColor
        label.font = UIFont.systemFont(ofSize: 12)
        label.text = kText("短信已发送至 +86 187****1321，请注意查收！")
        return label
    }()
    
    lazy var timeLabel:UILabel = {
       let label = BaseLabel(style: .twiceStyle)
       label.font = UIFont.systemFont(ofSize: 12)
       label.text = kText("56秒后重新发送验证码")
       return label
    }()
    
    lazy var selectBtn:UIButton = {
        let btn =  CommonBtn.creatSelectBtnWithTitle(title: kText("下一步"), y: 176.5, view: self, sel:  #selector(selectBtnAction))
        return btn
    }()
    
    var dataSource: SMSCodeViewController!
    
    init(dataSource: SMSCodeViewController!) {
        super.init(frame: CGRect.zero)
        
        self.dataSource = dataSource
        self.setUpUI()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUpUI() -> Void {
        
        self.addSubview(nameLabel)
        nameLabel.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalToSuperview().offset(28)
        }
        
        self.addSubview(timeLabel)
        timeLabel.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(128)
            make.centerX.equalToSuperview()
        }
        
        let passwordView = DKSetTradeView(title: "", cryptograph: true) { (password:String) in
            
        }
        self.addSubview(passwordView)
        
        self.addSubview(selectBtn)
    }
    
    
    @objc func selectBtnAction() -> Void {
        self.dataSource.navigationController?.pushViewController(BindTelphoneViewController(), animated: true)
    }
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
